/*
 * Copyright 2002 Christopher L. Conway, Cheng-Hong Li and Megan Pengelly.
 *
 * This file is part of The Pencil Compiler.
 *
 * The Pencil Compiler is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * The Pencil Compiler is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with The Pencil Compiler; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

/* @author Megan Pengelly */
package math.petrinets.model;

import com.mxgraph.model.mxCell;

public class Arc{
	private Place place ;
	private Transition transition ;
	private int weight ;
	private int bound ;

	private mxCell egde;

	public Arc(Place p) {
		this(p,1) ;
	}

	public Arc(Place p, int w) {
		super();
		place = p ;
		weight = w ;
		bound = p.getBound() ;
	}

	public void setPlace(Place place){
		this.place = place;
	}

	public Place getPlace(){
		return place;
	}

	public void setTransition(Transition transition){
		this.transition = transition;
	}

	public Transition getTransition(){
		return transition;
	}

	public void setWeight(int weight){
		this.weight = weight;
	}

	public int getWeight(){
		return weight;
	}

	public void setBound(int bound){
		this.bound = bound;
	}

	public int getBound(){
		return getPlace().getBound();
	}
	
	public void setEdge(Object cell) {
		this.egde = (mxCell) cell;
	}

	public mxCell getEdge() {
		return egde;
	}
	
}
